<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

   <ui:composition template="/templates/template_admin.xhtml">
        <ui:define name="content">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                        <h1><h:outputText value="List Vacancy"/></h1>
                        <p:dataTable id="dataTable" value="#{hrmb.vacancyList()}" var="vac" paginator="true" rows="5"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="3,5,10,15">
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="VacancyID"/>
                                </f:facet>
                                <h:outputText value="#{vac.vacancyID}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Title"/>
                                </f:facet>
                                <h:outputText value="#{vac.title}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="CreatedDate"/>
                                </f:facet>
                                <h:outputText value="#{vac.createdDate}">
                                    <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Status"/>
                                </f:facet>
                                <h:outputText value="#{vac.status}"/>
                            </p:column>                            
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Position"/>
                                </f:facet>
                                <h:outputText value="#{vac.position}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="WorkingPlace"/>
                                </f:facet>
                                <h:outputText value="#{vac.workingPlace}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="WorkType"/>
                                </f:facet>
                                <h:outputText value="#{vac.workType}"/>
                            </p:column>                                                                                                                                                                                     
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Gender"/>
                                </f:facet>
                                <h:outputText value="#{vac.gender}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Degree"/>
                                </f:facet>
                                <h:outputText value="#{vac.degree}"/>
                            </p:column>                            
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="ProbationaryPeriod"/>
                                </f:facet>
                                <h:outputText value="#{vac.probationaryPeriod}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Deadline"/>
                                </f:facet>
                                <h:outputText value="#{vac.deadline}">
                                    <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                                </h:outputText>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="DepartmentID"/>
                                </f:facet>
                                <h:outputText value="#{vac.departmentID.name}"/>
                            </p:column>
                            <p:column>
                                    <f:facet name="header">
                                        <h:outputText value="Action"/>
                                    </f:facet>
                                <h:commandLink value="View" action="#{hrmb.vacaView(vac)}"/><br/>
                                <h:commandLink value="Edit" action="#{hrmb.vacaEdit(vac)}"/><br/>                         
                                </p:column>
                        </p:dataTable>  
                        <p:commandButton action="CreateVaca" value="New Create"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
